@@ -110,10 +110,12 @@ def clerk_list(request): |
||
| 110 | 110 |
clerks = SaleclerkInfo.objects.filter(brand_id=administrator.brand_id, status=True).order_by('-pk')
|
| 111 | 111 |
if distributor_id: |
| 112 | 112 |
clerks = clerks.filter(distributor_id=distributor_id) |
| 113 |
+ count = clerks.count() |
|
| 113 | 114 |
clerks, left = pagination(clerks, page, num) |
| 114 | 115 |
clerks = [clerk.admindata for clerk in clerks] |
| 115 | 116 |
|
| 116 | 117 |
return response(200, 'Get Clerk List Success', u'获取销售员列表成功', {
|
| 117 | 118 |
'clerks': clerks, |
| 119 |
+ 'count': count, |
|
| 118 | 120 |
'left': left, |
| 119 | 121 |
}) |
@@ -99,10 +99,12 @@ def distributor_list(request): |
||
| 99 | 99 |
return response(AdministratorStatusCode.ADMINISTRATOR_NOT_FOUND) |
| 100 | 100 |
|
| 101 | 101 |
distributors = DistributorInfo.objects.filter(brand_id=administrator.brand_id, status=True).order_by('-pk')
|
| 102 |
+ count = distributors.count() |
|
| 102 | 103 |
distributors, left = pagination(distributors, page, num) |
| 103 | 104 |
distributors = [distributor.admindata for distributor in distributors] |
| 104 | 105 |
|
| 105 | 106 |
return response(200, 'Get Distributor List Success', u'获取经销商列表成功', {
|
| 106 | 107 |
'distributors': distributors, |
| 108 |
+ 'count': count, |
|
| 107 | 109 |
'left': left, |
| 108 | 110 |
}) |
@@ -112,10 +112,12 @@ def model_list(request): |
||
| 112 | 112 |
return response(AdministratorStatusCode.ADMINISTRATOR_NOT_FOUND) |
| 113 | 113 |
|
| 114 | 114 |
models = ModelInfo.objects.filter(brand_id=administrator.brand_id, status=True).order_by('-pk')
|
| 115 |
+ count = models.count() |
|
| 115 | 116 |
models, left = pagination(models, page, num) |
| 116 | 117 |
models = [mdl.admindata for mdl in models] |
| 117 | 118 |
|
| 118 | 119 |
return response(200, 'Get Model List Success', u'获取型号列表成功', {
|
| 119 | 120 |
'models': models, |
| 121 |
+ 'count': count, |
|
| 120 | 122 |
'left': left, |
| 121 | 123 |
}) |
@@ -118,10 +118,12 @@ def operator_list(request): |
||
| 118 | 118 |
return response(AdministratorStatusCode.ADMINISTRATOR_NOT_FOUND) |
| 119 | 119 |
|
| 120 | 120 |
optors = OperatorInfo.objects.filter(brand_id=administrator.brand_id, user_status=OperatorInfo.ACTIVATED, status=True).order_by('-pk')
|
| 121 |
+ count = optors.count() |
|
| 121 | 122 |
optors, left = pagination(optors, page, num) |
| 122 | 123 |
optors = [optor.data for optor in optors] |
| 123 | 124 |
|
| 124 | 125 |
return response(200, 'Get Operator List Success', u'获取操作员列表成功', {
|
| 125 | 126 |
'optors': optors, |
| 127 |
+ 'count': count, |
|
| 126 | 128 |
'left': left, |
| 127 | 129 |
}) |